<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="mfuny.ggongal.admin.http.HttpNotice" %>
<%@ page import="mfuny.ggongal.admin.debug.Debug" %>
<%@ page import="org.json.simple.*" %>
<%@ page trimDirectiveWhitespaces="true"%>
<%
request.setCharacterEncoding( "utf-8" );
response.setContentType( "text/html; charset=utf-8" );

HttpNotice notice = new HttpNotice();
String tag = request.getParameter("tag");

//공지사항 제목글들 가져오기.
if (tag.equals("notice_getSubjects")) {
	try{
		Object start = request.getParameter("start");
		JSONObject json = notice.notice_getSubjects(start);
		out.print(json.toJSONString());
	}catch(Exception e){
		Debug.toDebugFile(e, tag);
	}
}
//공지사항 특정 글 내용 가져오기.
else if (tag.equals("notice_getContent")) {
	try{
		int notice_no = Integer.parseInt(request.getParameter("notice_no"));
		JSONObject json = notice.notice_getContent(notice_no);
		out.print(json.toJSONString());
	}catch(Exception e){
		Debug.toDebugFile(e, tag);
	}
}
//가장 마지막 공지사항 내용 가져오기.
else if (tag.equals("notice_getFinalContent")) {
	try{
		JSONObject json = notice.notice_getFinalContent();
		out.print(json.toJSONString());
	}catch(Exception e){
		Debug.toDebugFile(e, tag);
	}
}
%>